package com.kakarote.hrm.service;

import com.alibaba.fastjson.JSONObject;
import com.kakarote.common.log.entity.OperationLog;
import com.kakarote.core.entity.BasePage;
import com.kakarote.core.entity.UploadEntity;
import com.kakarote.core.servlet.BaseService;
import com.kakarote.hrm.entity.BO.QueryRecruitPlanRecordPageListBO;
import com.kakarote.hrm.entity.PO.HrmRecruitPlanRecord;
import com.kakarote.hrm.entity.VO.RecruitPlanRecordVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 计划招聘记录 服务类
 * </p>
 *
 * @author system
 * @since 2024-01-01
 */
public interface IHrmRecruitPlanRecordService extends BaseService<HrmRecruitPlanRecord> {

    /**
     * 添加计划招聘记录
     *
     * @param recruitPlanRecord 计划招聘记录
     * @return 操作日志
     */
    OperationLog addRecruitPlanRecord(HrmRecruitPlanRecord recruitPlanRecord);

    /**
     * 修改计划招聘记录
     *
     * @param recruitPlanRecord 计划招聘记录
     * @return 操作日志
     */
    OperationLog setRecruitPlanRecord(HrmRecruitPlanRecord recruitPlanRecord);

    /**
     * 获取计划招聘记录详情
     *
     * @param recordId 记录id
     * @return 记录详情
     */
    RecruitPlanRecordVO queryById(Long recordId);

    /**
     * 查询计划招聘记录列表
     *
     * @param queryRecruitPlanRecordPageListBO 查询条件
     * @return 分页结果
     */
    BasePage<RecruitPlanRecordVO> queryRecruitPlanRecordPageList(QueryRecruitPlanRecordPageListBO queryRecruitPlanRecordPageListBO);

    /**
     * 根据计划id查询所有记录列表
     *
     * @param planId 计划id
     * @return 记录列表
     */
    List<RecruitPlanRecordVO> queryByPlanId(Long planId);

    /**
     * 删除计划招聘记录
     *
     * @param recordId 记录id
     * @return 操作日志
     */
    OperationLog deleteRecruitPlanRecord(Long recordId);

    /**
     * 批量删除计划招聘记录
     *
     * @param recordIds 记录id列表
     * @return 操作日志
     */
    OperationLog batchDeleteRecruitPlanRecord(List<Long> recordIds);

    /**
     * 根据计划id删除所有记录
     *
     * @param planId 计划id
     * @return 操作日志
     */
    OperationLog deleteByPlanId(Long planId);

    /**
     * 导出计划招聘记录
     *
     * @param response                           HTTP响应
     * @param queryRecruitPlanRecordPageListBO 查询条件
     * @throws IOException IO异常
     */
    void exportRecruitPlanRecord(HttpServletResponse response, QueryRecruitPlanRecordPageListBO queryRecruitPlanRecordPageListBO) throws IOException;

    /**
     * 下载导入模板
     *
     * @param response HTTP响应
     */
    void downloadExcel(HttpServletResponse response);

    /**
     * Excel导入招聘记录
     *
     * @param file 上传的文件
     * @return 导入结果
     */
    JSONObject excelImport(MultipartFile file);

    /**
     * 上传临时文件
     *
     * @param file   上传的文件
     * @param batchId 批次ID
     * @return 上传结果
     */
    UploadEntity uploadTempFile(MultipartFile file, String batchId);
}

